package exa.unicen.edu.ringo.rmodel.builder.factory;

import com.thoughtworks.xstream.XStream;



public class ModelFactory<M> {
	
	private XStream xstream;

	public ModelFactory(XStream xstream) {
		this.xstream = xstream;
	}
	
	@SuppressWarnings("unchecked")
	public M fromXML(String xml) {
		return ((M) xstream.fromXML(xml));
	}
	
	public String toXML(M model) {
		return xstream.toXML(model);
	}
}
